package com.huluobo.a2302mdmdemo.demo

import androidx.compose.runtime.Composable
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController

/**
 *  Created by LC on 2025/7/21.
 */

@Composable
fun MyNavigation() {
    //导航控制器
    val navHostController = rememberNavController()

    NavHost(navController = navHostController, startDestination = "2", builder = {
        //builder中添加的是在当前导航中可以展示的页面,类似于在清单文件中声明Activity,不声明的页面无法跳转
        composable("2") {
            FirstPage(navHostController = navHostController)
        }
        composable("sec") {
//            val string = it.arguments?.getString("str").toString()
            SecPage(navHostController = navHostController, str = "")
        }
    })
}